package time

import "time"

func Since(duration time.Duration, start time.Time) (ret interface{}) {
	switch duration {
	case time.Nanosecond:
		ret = time.Since(start).Nanoseconds()
	case time.Microsecond:
		ret = time.Since(start).Microseconds()
	case time.Millisecond:
		ret = time.Since(start).Milliseconds()
	case time.Second:
		ret = time.Since(start).Seconds()
	case time.Minute:
		ret = time.Since(start).Minutes()
	case time.Hour:
		ret = time.Since(start).Hours()
	}

	return ret

}
